/**
 * 
 */
package com.gs.gms.model.entity;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.Table;

/**
 * @author Sabuj Das | sabuj.das@gmail.com
 * 
 */
@Entity
@Table(name = "gms_role")
public class Role {

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "ROLE_ID", unique = true, nullable = false)
	private long roleId;

	@Column(name = "ROLE_NAME", nullable = false, length = 45)
	private String roleName;

	@Column(name = "ROLE_DESCRIPTION", length = 450)
	private String roleDescription;

	@ManyToMany(cascade = CascadeType.ALL, mappedBy="roles")
	private Set<User> users = new HashSet<>(0);

	public long getRoleId() {
		return roleId;
	}

	public void setRoleId(long roleId) {
		this.roleId = roleId;
	}

	public String getRoleName() {
		return roleName;
	}

	public void setRoleName(String roleName) {
		this.roleName = roleName;
	}

	public String getRoleDescription() {
		return roleDescription;
	}

	public void setRoleDescription(String roleDescription) {
		this.roleDescription = roleDescription;
	}

	public Set<User> getUsers() {
		return users;
	}

	public void setUsers(Set<User> users) {
		this.users = users;
	}
	
	
}
